package com.ambulance.project.biz.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Splitter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * v12
 * </p>
 *
 * @author zr
 * @since 2020-05-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("biz_ecg_wave_info")
@ApiModel(value="EcgWaveInfo对象", description="v12")
public class EcgWaveInfo extends Model<EcgWaveInfo> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "数据")
    @JsonIgnore
    @TableField("data")
    private String data;

    @ApiModelProperty(value = "数据类型")
    @TableField("sign_name")
    private String signName;

    @ApiModelProperty(value = "车辆标识")
    @TableField("carID")
    private Integer carID;

    @ApiModelProperty(value = "调度标识")
    @TableField("dispatchID")
    private Integer dispatchID;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "包数量")
    @TableField("package_num")
    private Integer packageNum;

    @ApiModelProperty(value = "参考id")
    @TableField("refer")
    private Integer refer;


    @ApiModelProperty(value = "数据内容")
    @TableField(exist = false)
    private List<String> content;
    public List<String> getContent() {
        return Splitter.on(",").splitToList(this.getData());
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
